<html>
<head>
	<meta charset="UTF-8">
	</head>
<body>
<script>
function changeImage()
{
element=document.getElementById('myimage')
if (element.src.match("bulbon"))
  {
  element.src="E:\\学习js\\html\\image\\eg_bulboff.gif";
  }
else
  {
  element.src="E:\\学习js\\html\\image\\eg_bulbon.gif";
  }
}
</script>

<img id="myimage" onclick="changeImage()" src="E:\\学习js\\html\\image\\eg_bulboff.gif">

<p>点击灯泡来点亮或熄灭这盏灯</p>

</body>
</html>